package com.bj58.ecdata.dashboard.constant;

public class IncomeCustomerConst {
	/**
	 * 客户余额结构查询列，查询条件
	 * @param dateGroup
	 * @return
	 */
	public static String getCustomerProCol(String dateGroup){
		return dateGroup+",user_num,balance_0,balance_50,cash_balance_0,cash_balance_50,jingzhun_num,zhineng_num,zhiding_num," +
				"jingzhun_num_per,zhineng_num_per,zhiding_num_per";
	}
	
	private static final String PATTEN_CatePro = "user_type='%s' AND business_type='%s' AND stat_type='%s' GROUP BY %s";
	
	public static String getCustomerProCon(String dateGroup, String stat_type, String businessName, String userType){
		return String.format(PATTEN_CatePro, userType, businessName, stat_type, dateGroup);
	}
	/**
	 * 2
	 * */
	public static String getCustomerProCol1(String dateGroup){
		return dateGroup+",user_type,user_num,balance_0,balance_50,cash_balance_0,cash_balance_50,jingzhun_num,zhineng_num,zhiding_num," +
				"jingzhun_num_per,zhineng_num_per,zhiding_num_per";
	}
    private static final String PATTEN_CatePro1 = "business_type='%s' AND stat_type='%s'";
	
	public static String getCustomerProCon1(String dateGroup, String stat_type, String businessName, String customerIndex){
		return String.format(PATTEN_CatePro1,businessName, stat_type);
	}
	/**
	 * 漏斗图部分
	 * */
	public static String getCustomerProForFunnel(String dateGroup){
		return dateGroup+",user_type,user_num,balance_0,balance_50,cash_balance_0,cash_balance_50";
	}
    private static final String PATTEN_CustomerForFunnel = "business_type='%s' AND stat_type='%s' AND %s='%s'";
	
	public static String getCustomerProForFunnel(String dateGroup, String daytypenum, String businessName,String daytype){
		return String.format(PATTEN_CustomerForFunnel,businessName,daytype,dateGroup,daytypenum);
	}
	/**
	 * 客户新增部分
	 * */
	public static String getCustomerProForNew(){
		return "stat_date,user_type,user_num,user_num_chain,arpu,arpu_chain";
	}
    private static final String PATTEN_CustomerForNew = "business_type='%s' and stat_type='%s' and product_type='%s'";
	
	public static String getCustomerProForNew(String businessName, String daytype,String producttype){
		return String.format(PATTEN_CustomerForNew,businessName,daytype,producttype);
	}
	/**
	 *展现消费部分 
	 * */
	public static String getCustomerProForDispcost(String dateGroup){
		return dateGroup+",user_type,user_num,user_num_chain,arpu,arpu_chain";
	}
    private static final String PATTEN_CustomerForDispcost = "business_type='%s' and stat_type='%s' and product_type='%s'";
	
	public static String getCustomerProForDispcost(String daytype,String businessName,String producttype){
		return String.format(PATTEN_CustomerForDispcost,businessName,daytype,producttype);
	}
	/**
	 *余额消费散点图部分 
	 * */
	public static String getCustomerProForCostbalance(){
		return "user_type,user_id,cost,balance";
	}
    private static final String PATTEN_CustomerForCostbalance = "business_type='%s' and stat_type='%s' and product_type='%s' AND %s='%s'";
	
	public static String getCustomerProForCostbalance(String dateGroup,String dateval,String businessName,String producttype,String daytype){
		return String.format(PATTEN_CustomerForCostbalance,businessName,daytype,producttype,dateGroup,dateval);
	}
	/**
	 * 现金余额与周期散点图部分
	 * */
	public static String getCustomerProForCashCircle(){
		return "user_type,user_id,cash_balance,consume_cycle";
	}
	 private static final String PATTEN_CustomerForCashCircle = "business_type='%s' and stat_type='%s' AND %s='%s'";
		
	 public static String getCustomerProForCashcircle(String dateGroup,String dateval,String businessName,String daytype){
			return String.format(PATTEN_CustomerForCashCircle,businessName,daytype,dateGroup,dateval);
	}
	/**
	 * 智能置顶转换部分
	 * */
	public static String getCustomerProForTransfer(){
		return "stat_date,user_type,user_num,user_num_chain,user_num_per,user_num_per_chain";
	}
    private static final String PATTEN_CustomerForTransfer = "business_type='%s' and stat_type='%s' and product_type='%s'";
	
	public static String getCustomerProForTransfer(String daytype,String businessName,String producttype){
		return String.format(PATTEN_CustomerForTransfer,businessName,daytype,producttype);
	}
	/**
	 * 当天的余额客户数据表格查询内容
	 * @param dateGroup
	 * @return
	 */
	private static final String CustomerPro_Table = "%s='%s' AND business_type='%s' AND stat_type='%s' GROUP BY user_type";
	
	public static String getCustomerProTableCon(String dateGroup, String stat_type, String businessName, String dateVal){
		return String.format(CustomerPro_Table, dateGroup,dateVal, businessName, stat_type);
	}
	/**
	 * 当天展现消费客户数据表格查询内容
	 * @param dateGroup
	 * @return
	 */
	private static final String CustomerDispCostPro_Table = "%s='%s' AND business_type='%s' AND stat_type='%s'";
	
	public static String getCustomerDispTableCon(String dateGroup,String stat_type, String businessName, String dateVal){
		return String.format(CustomerDispCostPro_Table,dateGroup,dateVal, businessName, stat_type);
	}
	/**
	 * 当天转换置顶数据表格查询内容
	 * @param dateGroup
	 * @return
	 */
	private static final String CustomerTransferPro_Table = "stat_date='%s' AND business_type='%s' AND stat_type='%s'";
	
	public static String getCustomerTransferTableCon(String stat_type, String businessName, String dateVal){
		return String.format(CustomerTransferPro_Table,dateVal, businessName, stat_type);
	}
	/**
	 * 当天的新增客户数据表格查询内容
	 * @param dateGroup
	 * @return
	 */
	private static final String CustomerPro_Table_New = "business_type='%s' AND stat_type='%s' AND stat_date='%s'";
	
	public static String getCustomerProTableConForNew(String businessName,String dateVal,String datetype){
		return String.format(CustomerPro_Table_New, businessName, datetype,dateVal);
	}
}
